<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Message extends Pre_Controller {
    public function __construct()
    {
        parent::__construct();
        $this->load->Model('Message_model');
    }

    public function SubMsg()
    {

        $this->load->library('ajaxMsgModel');


        $messageModel=new $this->Message_model();
        $messageModel->content=$this->input->post('content');
        $messageModel->name=$this->input->post('name');
        $messageModel->tel=$this->input->post('tel');
        $messageModel->tel=date('Y-m-d');
        $res= $this->Message_model->Add_Message($messageModel);
        if($res>0)
        {
            $this->ajaxmsgmodel->Msg='提交成功';
            $this->ajaxmsgmodel->Statu='ok';
        }
        else
        {
            $this->ajaxmsgmodel->Msg='提交失败';
            $this->ajaxmsgmodel->Statu='err';
        }
        echo(json_encode($this->ajaxmsgmodel));
    }
}
?>